package com.example.springweb.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.springweb.model.dto.ProductDTO;
import com.example.springweb.model.entity.Product;
import com.example.springweb.model.vo.ProductVo;

@Mapper
public interface ProductMapper extends BaseMapper<Product> {
	
	
	ProductVo findProductById(Long id);
	
	IPage<ProductVo> findPruductByCategory(@Param("page") Page<ProductDTO> page, @Param("dto") ProductDTO dto);
	
//	@Insert({"<script>",
//		"insert into product(id, category, product_name, product_price)",
//		"values(#{id}, #{category}, #{productName}, #{productPrice})",
//		"</script>"})
//	int insert(Product product);

//	List<Product> selectList(Page<Product> page, QueryWrapper<ProductDTO> wrapper);
}
